package ca.mark.mycode.sqlite;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class SqliteTestActivity extends Activity {
	private Button dbButton;
	
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        dbButton=(Button) findViewById(R.id.button1);
        dbButton.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				SqliteOperation mydb=new SqliteOperation(SqliteTestActivity.this);
				mydb.openDB();
				User myuUser=new User();
				myuUser.setUserName("ike");
				myuUser.setUserAddress("ShangHai");
				mydb.inserUsers(myuUser);
				
				mydb.queryall();
				
				mydb.closeDB();
			
			}
		});
        
        
    }
}